package com.sjy.project.fym.apply.service.impl;

import java.util.List;
import com.sjy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sjy.project.fym.apply.mapper.FyGoodsApplyHisMapper;
import com.sjy.project.fym.apply.domain.FyGoodsApplyHis;
import com.sjy.project.fym.apply.service.IFyGoodsApplyHisService;
import com.sjy.common.utils.text.Convert;

/**
 * 审批记录Service业务层处理
 * 
 * @author ljb
 * @date 2022-05-04
 */
@Service
public class FyGoodsApplyHisServiceImpl implements IFyGoodsApplyHisService 
{
    @Autowired
    private FyGoodsApplyHisMapper fyGoodsApplyHisMapper;

    /**
     * 查询审批记录
     * 
     * @param hisId 审批记录主键
     * @return 审批记录
     */
    @Override
    public FyGoodsApplyHis selectFyGoodsApplyHisByHisId(Long hisId)
    {
        return fyGoodsApplyHisMapper.selectFyGoodsApplyHisByHisId(hisId);
    }

    /**
     * 查询审批记录列表
     * 
     * @param fyGoodsApplyHis 审批记录
     * @return 审批记录
     */
    @Override
    public List<FyGoodsApplyHis> selectFyGoodsApplyHisList(FyGoodsApplyHis fyGoodsApplyHis)
    {
        return fyGoodsApplyHisMapper.selectFyGoodsApplyHisList(fyGoodsApplyHis);
    }

    /**
     * 新增审批记录
     * 
     * @param fyGoodsApplyHis 审批记录
     * @return 结果
     */
    @Override
    public int insertFyGoodsApplyHis(FyGoodsApplyHis fyGoodsApplyHis)
    {
        fyGoodsApplyHis.setCreateTime(DateUtils.getNowDate());
        return fyGoodsApplyHisMapper.insertFyGoodsApplyHis(fyGoodsApplyHis);
    }

    /**
     * 修改审批记录
     * 
     * @param fyGoodsApplyHis 审批记录
     * @return 结果
     */
    @Override
    public int updateFyGoodsApplyHis(FyGoodsApplyHis fyGoodsApplyHis)
    {
        fyGoodsApplyHis.setUpdateTime(DateUtils.getNowDate());
        return fyGoodsApplyHisMapper.updateFyGoodsApplyHis(fyGoodsApplyHis);
    }

    /**
     * 批量删除审批记录
     * 
     * @param hisIds 需要删除的审批记录主键
     * @return 结果
     */
    @Override
    public int deleteFyGoodsApplyHisByHisIds(String hisIds)
    {
        return fyGoodsApplyHisMapper.deleteFyGoodsApplyHisByHisIds(Convert.toStrArray(hisIds));
    }

    /**
     * 删除审批记录信息
     * 
     * @param hisId 审批记录主键
     * @return 结果
     */
    @Override
    public int deleteFyGoodsApplyHisByHisId(Long hisId)
    {
        return fyGoodsApplyHisMapper.deleteFyGoodsApplyHisByHisId(hisId);
    }
}
